jQuery(function() {
	var form = jQuery("#edit_form").validate({
		submitHandler: function(form) {
			jQuery(form).ajaxSubmit(function(date) {
				try{
				   var result =eval("("+date+")");//转换为json对象
				}catch(err){
				   alert("构造JSON格式错误\n\n"+date);
				}
               	if(result.type=="error"){
               		alert("出错："+result.message);
               	}
               	
               	if(result.type=="success"){
               		//alert("成功："+result.message);
               		//parent.refresh();
               		//window.opener.document.location.reload();
               		window.opener.refresh();
               		window.opener.setMsg(result.message);
					self.close();
               	}
           	});
		}
	});
});